/*
 * Copyright 2024 the original author or authors.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package io.gitee.joyz.api.result.i18n;

/**
 * 分层的国际化消息接口. 该接口实现类允许为其设置一个父 LocaleMessage 实例,
 * 当消息无法查找到时, 会委托给其父实例 <i>(存在的话)</i> 来解析
 *
 * @author JoyZ
 */
public interface HierarchicalLocaleMessage extends LocaleMessage {

    /**
     * 设置一个父国际化组件实例
     *
     * @param parent 父 LocaleMessage 实例
     */
    void setParent(LocaleMessage parent);

    /**
     * 获取设置的父国际化组件实例
     *
     * @return 父 LocaleMessage 实例, 如果未设置则返回 null
     */
    LocaleMessage getParent();
}
